Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix updating vanity URL & widget.json #1194

Conversation

DEVTomatoCake
Copy link
Member

  • Currently, setting a vanity url on a server with no or more than one invite fails due either a logical error or PRIMARY key constraints when trying to update previous invite links. This PR deletes previous vanity URLs (normal invite links aren't affected) and inserts the new one.
  • flags has no default value, so it has to be set to 0 (default from channel invite create endpoint¹)
  • Removed expires_at: new Date(), to be consistent with channel invite create endpoint²
  • typeorm is unintuitive (when specifying select, it only selects those properties and uses the default for all others) so I broke widget.json in Fix widget.json & fix channel ordering when deleting channels #1184. This PR adds the required properties to the requested ones.

References

¹

²

const expires_at =
body.max_age == 0 || body.max_age == undefined
? undefined

@MaddyUnderStars MaddyUnderStars merged commit 60f22c2 into spacebarchat:master Aug 23, 2024
3 checks passed
@DEVTomatoCake DEVTomatoCake deleted the fix/update-vanity-url-widget-invite branch August 24, 2024 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants